﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Maps.MapControl;
//using ODAF.SilverlightApp.SearchService;

namespace ODAF.SilverlightApp.CloudService
{
    public class ServiceController
    {
        public string BaseURL { get; set; }
        public SummariesController Summaries { get; set; }
        public UserController User{ get; set; }

        public ServiceController(string baseURL)
        {
            BaseURL = baseURL;

            Summaries = new SummariesController();
            Summaries.baseController = this;
            Summaries.BaseURL = BaseURL;

            User = new UserController();
            User.BaseURL = BaseURL;



            //SearchServiceClient geoSearchClient = new SearchServiceClient("BasicHttpBinding_ISearchService");
            //SearchRequest req = new SearchRequest();
            //req.Credentials = new Credentials();
            //req.Credentials.ApplicationId = "AiN8LzMeybPbj9CSsLqgdeCG86jg08SJsjm7pms3UNtNTe8YJHINtYVxGO5l4jBj";
            //StructuredSearchQuery query = new StructuredSearchQuery();
            //query.Keyword = "Tree";
            //query.Location = "Vancouver, BC, Canada Whistler";
            
            
            //req.StructuredQuery = query;
            //req.SearchOptions = new SearchOptions();
            //req.SearchOptions.Count = 25;
            //req.SearchOptions.ListingType = ListingType.CommunityContent;
           
            
            //geoSearchClient.SearchCompleted += new EventHandler<SearchCompletedEventArgs>(geoSearchClient_SearchCompleted);
            //geoSearchClient.SearchAsync(req);
        }

        //void geoSearchClient_SearchCompleted(object sender, SearchCompletedEventArgs e)
        //{
        //    if (e.Error != null)
        //    {

        //    }
        //    else
        //    {
        //        SearchResponse searchResponse = e.Result;
        //        for (int index = 0; index < searchResponse.ResultSets[0].Results.Count; index++)
        //        {

        //        }
        //    }
        //}




    }
}
